package com.appdemo.demo;

import com.google.common.util.concurrent.RateLimiter;

/**
 * @author ycd0075
 * @date 2023-03-03 15:42
 */
public class GuavaLimit {


    public static void main(String[] args) {

        RateLimiter limiter = RateLimiter.create(1);
        System.out.println(limiter.acquire(2));
        System.out.println(limiter.acquire(6));
        System.out.println(limiter.acquire(2));

    }

}
